package cn.cy.behavior.mediator.general;

/**
 * @author yangxq
 * @desc
 * @date 2025-05-10
 */
public class User {

    private String name;

    public User(String name) {
        this.name = name;
    }

    public void sendMessage(String message, User user) {
        System.out.println(this.name + " sends message: " + message + " to " + user.name);
        user.receiveMessage(message);
    }

    public void receiveMessage(String message) {
        System.out.println(this.name + " received message: " + message);
    }

}
